Fix a flaky test relying on nondeterminsm
authorAlex Crichton <alex@alexcrichton.com>
Thu, 23 Oct 2014 19:12:03 +0000 (12:12 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Mon, 27 Oct 2014 19:40:23 +0000 (12:40 -0700)
commit6ab9311754474868b7e908d5908ce048afa76f8f
treeffdad9d2be07bb077576d00af3ec1c2f68c9f6b5
parentf8dcf54ca8ad04184246fb12c45b04b3654d64b7
Fix a flaky test relying on nondeterminsm

When updating a source with multiple packages, the registry will lazily discover
both the precise and imprecise versions of the source at some point. Previously
the source would be updated depending on which was discovered first, but this
commit adds logic to understand that if an imprecise version is discovered after
a precise version then the imprecise version should be favored (because it will
always trigger an update).

This needs to understand, however, that if `cargo update --precise` is used that
those sources should not be updated again, so the sources treated in
`add_sources` are considered "special" in the sense that they're locked and will
not be updated again.
src/cargo/core/registry.rs
tests/test_cargo_compile_git_deps.rs